//
//  SubjectsTableDelegator.m
//  LanguagesTeach
//
//  Created by Niel Santos on 12/16/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "SubjectsTableViewDelegator.h"
#import "IntroductionController.h"
#import "RowTableCell.h"

@implementation SubjectsTableViewDelegator

@synthesize navigationController;

- (id)init:(SubjectPath*) initSubjectPath {
	
    if (self = [super init]){
		subjectPath = initSubjectPath;
    }
    return self;		
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
	RowTableCell *cell;
	
	IntroductionController *introductionController;
	
	
	cell = (RowTableCell*)[tableView cellForRowAtIndexPath:indexPath];
	introductionController = [[IntroductionController alloc] initWithNibName:@"Introduction" bundle:nil];
	//introductionController = [[IntroductionController alloc] initWithNibName:@"Languages" bundle:nil];
	subjectPath.subject = [cell prefix];
	introductionController.subjectPath = subjectPath;
	[self.navigationController pushViewController:introductionController animated:YES];
	[introductionController release];
	[tableView deselectRowAtIndexPath:indexPath animated:YES];
}



@end
